package cn.agiledata.bank.common.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import cn.agiledata.bank.common.util.Constant;
import cn.agiledata.bank.myspace.service.AuthenticateService;

import com.vnv.infrastructure.action.IPBBaseAction;
import com.vnv.infrastructure.exception.IPBException;
import com.vnv.infrastructure.logic.IPBAppFactory;

//不登陆的话，执行的action类
public class NoLoginAction extends IPBBaseAction {
    /**
     * 有权限
     */
    public int hasAccessPermission(int accessLevel, HttpServletRequest request)
            throws IPBException {
        return 1;
    }

    /**
     * 显示支付链
     * 
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return
     * @throws IPBException
     * @throws Exception
     */
    public ActionForward showChain(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws IPBException, Exception {
        
        return mapping.findForward(Constant.SHOWCHAIN);
    }

    public ActionForward chainPay(ActionMapping mapping, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) {
      
        return mapping.findForward("success");
    }

    private AuthenticateService getAuthenticateService() {
        return (AuthenticateService) IPBAppFactory
                .getObj("authenticateService");
    }
}
